//1.导入axios
import axios from 'axios'
import auth from '@/auth/auth.js';

var baseURL = "http://192.168.43.185:8080/";

//创建axios实例
const axiosInstance = axios.create({
        baseURL: baseURL, //前置URL地址
        timeout: 500000 // 请求超时时间
    })
    //定义拦截器
axiosInstance.interceptors.request.use(function(config) {
    config.headers.Authorization = auth.getToken();
    return config;
}, function(error) {
    return Promise.reject(error);
});

//2.默认导出
export { axiosInstance, baseURL };
//